<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>avalon: ConnectPool Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">avalon
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_connect_pool-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ConnectPool Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>提供了连接池的功能，用于管理和异步化与消息代理的连接和通信。  
 <a href="#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="connect__pool_8h_source.html">connect_pool.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa65c29a74c0cfbb6b1f2ba93b413bbd8" id="r_aa65c29a74c0cfbb6b1f2ba93b413bbd8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa65c29a74c0cfbb6b1f2ba93b413bbd8">ConnectPool</a> (const std::string &amp;amqp_address)</td></tr>
<tr class="memdesc:aa65c29a74c0cfbb6b1f2ba93b413bbd8"><td class="mdescLeft">&#160;</td><td class="mdescRight">构造函数，初始化连接池并设置AMQP地址。  <br /></td></tr>
<tr class="separator:aa65c29a74c0cfbb6b1f2ba93b413bbd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97c432b8a39cca43799e33a0ff23c575" id="r_a97c432b8a39cca43799e33a0ff23c575"><td class="memItemLeft" align="right" valign="top"><a id="a97c432b8a39cca43799e33a0ff23c575" name="a97c432b8a39cca43799e33a0ff23c575"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>~ConnectPool</b> ()</td></tr>
<tr class="memdesc:a97c432b8a39cca43799e33a0ff23c575"><td class="mdescLeft">&#160;</td><td class="mdescRight">析构函数，释放连接池中的所有资源。 <br /></td></tr>
<tr class="separator:a97c432b8a39cca43799e33a0ff23c575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3660145a41de7291c40962f6f8dc9e4" id="r_af3660145a41de7291c40962f6f8dc9e4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af3660145a41de7291c40962f6f8dc9e4">init</a> (int thread_num)</td></tr>
<tr class="memdesc:af3660145a41de7291c40962f6f8dc9e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化连接池，创建指定数量的工作线程。  <br /></td></tr>
<tr class="separator:af3660145a41de7291c40962f6f8dc9e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef3cb55da5535dd190d3afa5ef453d41" id="r_aef3cb55da5535dd190d3afa5ef453d41"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aef3cb55da5535dd190d3afa5ef453d41">addProvider</a> (<a class="el" href="class_provider.html">Provider</a> *provider)</td></tr>
<tr class="memdesc:aef3cb55da5535dd190d3afa5ef453d41"><td class="mdescLeft">&#160;</td><td class="mdescRight">添加消息提供者到连接池。  <br /></td></tr>
<tr class="separator:aef3cb55da5535dd190d3afa5ef453d41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2678da26366a30b9c8fc3b02877cd13" id="r_ad2678da26366a30b9c8fc3b02877cd13"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad2678da26366a30b9c8fc3b02877cd13">dispatch</a> (<a class="el" href="class_deliver.html">Deliver</a> *deliver)</td></tr>
<tr class="memdesc:ad2678da26366a30b9c8fc3b02877cd13"><td class="mdescLeft">&#160;</td><td class="mdescRight">分发消息到所有连接器。  <br /></td></tr>
<tr class="separator:ad2678da26366a30b9c8fc3b02877cd13"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>提供了连接池的功能，用于管理和异步化与消息代理的连接和通信。 </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aa65c29a74c0cfbb6b1f2ba93b413bbd8" name="aa65c29a74c0cfbb6b1f2ba93b413bbd8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa65c29a74c0cfbb6b1f2ba93b413bbd8">&#9670;&#160;</a></span>ConnectPool()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">ConnectPool::ConnectPool </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;</td>          <td class="paramname"><span class="paramname"><em>amqp_address</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>构造函数，初始化连接池并设置AMQP地址。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">amqp_address</td><td>AMQP地址，用于连接消息代理。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aef3cb55da5535dd190d3afa5ef453d41" name="aef3cb55da5535dd190d3afa5ef453d41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef3cb55da5535dd190d3afa5ef453d41">&#9670;&#160;</a></span>addProvider()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectPool::addProvider </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_provider.html">Provider</a> *</td>          <td class="paramname"><span class="paramname"><em>provider</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>添加消息提供者到连接池。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">provider</td><td>消息提供者，用于生产消息到消息代理。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad2678da26366a30b9c8fc3b02877cd13" name="ad2678da26366a30b9c8fc3b02877cd13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2678da26366a30b9c8fc3b02877cd13">&#9670;&#160;</a></span>dispatch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectPool::dispatch </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_deliver.html">Deliver</a> *</td>          <td class="paramname"><span class="paramname"><em>deliver</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>分发消息到所有连接器。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">deliver</td><td>消息分发者，包含要发送的消息。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af3660145a41de7291c40962f6f8dc9e4" name="af3660145a41de7291c40962f6f8dc9e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3660145a41de7291c40962f6f8dc9e4">&#9670;&#160;</a></span>init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ConnectPool::init </td>
          <td>(</td>
          <td class="paramtype">int</td>          <td class="paramname"><span class="paramname"><em>thread_num</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化连接池，创建指定数量的工作线程。 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread_num</td><td>工作线程的数量，决定了并行处理的能力。</td></tr>
  </table>
  </dd>
</dl>
<p>初始化连接池</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">thread_num</td><td>需要创建的连接器数量，即线程数量</td></tr>
  </table>
  </dd>
</dl>
<p>此函数负责根据指定的线程数量创建连接器对象并启动它们所有的连接器对象 都将被存储在内部的连接器列表中以便后续管理和使用 </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>E:/avalon/src/libavalon/<a class="el" href="connect__pool_8h_source.html">connect_pool.h</a></li>
<li>E:/avalon/src/libavalon/<b>connect_pool.cpp</b></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
